<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="theme-color" content="#0078E7"><meta name="author" content="爱肖彤真是太好了"><meta name="copyright" content="爱肖彤真是太好了"><meta name="generator" content="Hexo 5.1.1"><meta name="theme" content="hexo-theme-yun"><title>4000字总结python基础 | 工藤旧二の博客</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&amp;display=swap" media="none" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/star-markdown-css@0.1.19/dist/yun/yun-markdown.min.css"><script src="//at.alicdn.com/t/font_1140697_stqaphw3j4.js" async></script><script src="https://cdn.jsdelivr.net/npm/scrollreveal/dist/scrollreveal.min.js" defer></script><script>document.addEventListener("DOMContentLoaded", () => {
  [".post-card",".post-content img"].forEach((target)=> {
    ScrollReveal().reveal(target);
  })
});
</script><link rel="shortcut icon" type="image/svg+xml" href="/task/yun.ico"><link rel="mask-icon" href="/task/yun.ico" color="#0078E7"><link rel="alternate icon" href="/yun.ico"><link rel="preload" href="/task/css/hexo-theme-yun.css" as="style"><link rel="preload" href="/task/js/utils.js" as="script"><link rel="preload" href="/task/js/hexo-theme-yun.js" as="script"><link rel="prefetch" href="/task/js/sidebar.js" as="script"><link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin><link rel="stylesheet" href="/task/css/hexo-theme-yun.css"><link rel="alternate" href="/task/atom.xml" title="工藤旧二の博客" type="application/atom+xml"><script id="yun-config">
    const Yun = window.Yun || {};
    window.CONFIG = {"root":"/task/","title":"工藤旧二の博客","version":"0.9.7","anonymous_image":"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/avatar/none.jpg","say":{"api":"https://v1.hitokoto.cn","hitokoto":true},"local_search":{"path":"/task/search.xml"},"fireworks":{"colors":["102, 167, 221","62, 131, 225","33, 78, 194"]}};
  </script><script>(function(){
  var bp = document.createElement('script');
  var curProtocol = window.location.protocol.split(':')[0];
  if (curProtocol === 'https') {
    bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else {
    bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(bp, s);
})();</script><meta name="description" content="核心知识点：python入门一、python入门day1-day24day01-03 编程语言python是一种强类型的解释型语言 day04 变量变量名不能以数字开头 小整数池的范围[-5,256]，pycharm里这个范围非常大 这是为了优化内存的合理安排 指向相同数字的变量名id相同 day05 垃圾回收机制（GC机制）为了解决没有被引用的数据（垃圾）大量占用内存导致程序崩溃 1 引用计数a">
<meta property="og:type" content="article">
<meta property="og:title" content="4000字总结python基础">
<meta property="og:url" content="http://huang_zhao.gitee.io/task/2020/03/15/python/%E5%AD%A6%E4%B9%A0/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%EF%BC%9Apython%E5%85%A5%E9%97%A8/index.html">
<meta property="og:site_name" content="工藤旧二の博客">
<meta property="og:description" content="核心知识点：python入门一、python入门day1-day24day01-03 编程语言python是一种强类型的解释型语言 day04 变量变量名不能以数字开头 小整数池的范围[-5,256]，pycharm里这个范围非常大 这是为了优化内存的合理安排 指向相同数字的变量名id相同 day05 垃圾回收机制（GC机制）为了解决没有被引用的数据（垃圾）大量占用内存导致程序崩溃 1 引用计数a">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-03-15T05:33:43.000Z">
<meta property="article:modified_time" content="2021-07-01T05:29:27.000Z">
<meta property="article:author" content="爱肖彤真是太好了">
<meta property="article:tag" content="python">
<meta property="article:tag" content="python基础">
<meta name="twitter:card" content="summary"><script src="/task/js/ui/mode.js"></script><link rel="stylesheet" href="/task/css/prism.css" type="text/css"></head><body><script defer src="https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js"></script><script defer src="/task/js/ui/fireworks.js"></script><canvas class="fireworks"></canvas><div class="container"><a class="sidebar-toggle hty-icon-button" id="menu-btn"><div class="hamburger hamburger--spin" type="button"><span class="hamburger-box"><span class="hamburger-inner"></span></span></div></a><div class="sidebar-toggle sidebar-overlay"></div><aside class="sidebar"><script src="/task/js/sidebar.js"></script><ul class="sidebar-nav"><li class="sidebar-nav-item sidebar-nav-toc hty-icon-button sidebar-nav-active" data-target="post-toc-wrap" title="文章目录"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-list-ordered"></use></svg></li><li class="sidebar-nav-item sidebar-nav-overview hty-icon-button" data-target="site-overview-wrap" title="站点概览"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-passport-line"></use></svg></li></ul><div class="sidebar-panel" id="site-overview-wrap"><div class="site-info fix-top"><a class="site-author-avatar" href="/task/about/" title="爱肖彤真是太好了"><img width="96" loading="lazy" src="/task/Yun.png" alt="爱肖彤真是太好了"></a><div class="site-author-name"><a href="/task/about/">爱肖彤真是太好了</a></div><a class="site-name" href="/task/about/site.html">工藤旧二の博客</a><sub class="site-subtitle"></sub><div class="site-desciption"></div></div><nav class="site-state"><a class="site-state-item hty-icon-button icon-home" href="/task/" title="首页"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-home-4-line"></use></svg></span></a><div class="site-state-item"><a href="/task/archives/" title="归档"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-archive-line"></use></svg></span><span class="site-state-item-count">57</span></a></div><div class="site-state-item"><a href="/task/categories/" title="分类"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-2-line"></use></svg></span><span class="site-state-item-count">2</span></a></div><div class="site-state-item"><a href="/task/tags/" title="标签"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="site-state-item-count">50</span></a></div><a class="site-state-item hty-icon-button" target="_blank" rel="noopener" href="https://yun.yunyoujun.cn" title="文档"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-settings-line"></use></svg></span></a></nav><hr style="margin-bottom:0.5rem"><div class="links-of-author"><a class="links-of-author-item hty-icon-button" rel="noopener" title="RSS" target="_blank" style="color:orange"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-rss-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="QQ" target="_blank" style="color:#12B7F5"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-qq-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="GitHub" target="_blank" style="color:#6e5494"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-github-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="微博" target="_blank" style="color:#E6162D"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-weibo-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="豆瓣" target="_blank" style="color:#007722"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-douban-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://music.163.com/#/user/home?id=552858287" title="网易云音乐" target="_blank" style="color:#C20C0C"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-netease-cloud-music-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="知乎" target="_blank" style="color:#0084FF"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-zhihu-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" href="https://space.bilibili.com/15081363" title="哔哩哔哩" target="_blank" style="color:#FF8EB3"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-bilibili-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="Twitter" target="_blank" style="color:#1da1f2"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-twitter-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="Telegram Channel" target="_blank" style="color:#0088CC"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-telegram-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="E-Mail" target="_blank" style="color:#8E71C1"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-mail-line"></use></svg></a><a class="links-of-author-item hty-icon-button" rel="noopener" title="Travelling" target="_blank" style="color:var(--hty-text-color)"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-send-plane-2-line"></use></svg></a></div><hr style="margin:0.5rem 1rem"><div class="links"><a class="links-item hty-icon-button" href="/task/links/" title="我的小伙伴们" style="color:dodgerblue"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-genderless-line"></use></svg></a></div><br><a class="links-item hty-icon-button" id="toggle-mode-btn" href="javascript:;" title="Mode" style="color: #f1cb64"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-contrast-2-line"></use></svg></a></div><div class="sidebar-panel sidebar-panel-active" id="post-toc-wrap"><div class="post-toc"><div class="post-toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%EF%BC%9Apython%E5%85%A5%E9%97%A8"><span class="toc-text">核心知识点：python入门</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%E3%80%81python%E5%85%A5%E9%97%A8day1-day24"><span class="toc-text">一、python入门day1-day24</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#day01-03-%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80"><span class="toc-text">day01-03 编程语言</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day04-%E5%8F%98%E9%87%8F"><span class="toc-text">day04 变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day05-%E5%9E%83%E5%9C%BE%E5%9B%9E%E6%94%B6%E6%9C%BA%E5%88%B6%EF%BC%88GC%E6%9C%BA%E5%88%B6%EF%BC%89"><span class="toc-text">day05 垃圾回收机制（GC机制）</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E5%BC%95%E7%94%A8%E8%AE%A1%E6%95%B0"><span class="toc-text">1 引用计数</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E6%A0%87%E8%AE%B0%E6%B8%85%E9%99%A4"><span class="toc-text">2 标记清除</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-%E5%88%86%E4%BB%A3%E5%9B%9E%E6%94%B6"><span class="toc-text">3 分代回收</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day05-%E7%A8%8B%E5%BA%8F%E4%BA%A4%E4%BA%92%E4%B8%8E%E5%9F%BA%E6%9C%AC%E8%BF%90%E7%AE%97%E7%AC%A6"><span class="toc-text">day05 程序交互与基本运算符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day06-%E5%8F%AF%E5%8F%98%E4%B8%8D%E5%8F%AF%E5%8F%98%E7%B1%BB%E5%9E%8B"><span class="toc-text">day06 可变不可变类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day07-%E6%B5%81%E7%A8%8B%E6%8E%A7%E5%88%B6"><span class="toc-text">day07 流程控制</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E8%B5%8B%E5%80%BC"><span class="toc-text">1 赋值 &#x3D;</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E6%B5%85%E6%8B%B7%E8%B4%9D-copy"><span class="toc-text">2 浅拷贝 copy</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-%E6%B7%B1%E6%8B%B7%E8%B4%9D-deepcopy"><span class="toc-text">3 深拷贝 deepcopy</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day08-10-%E5%9F%BA%E6%9C%AC%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B"><span class="toc-text">day08-10 基本数据类型</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E5%AD%97%E7%AC%A6%E4%B8%B2"><span class="toc-text">1 字符串</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E5%88%97%E8%A1%A8"><span class="toc-text">2 列表</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-%E5%85%83%E7%BB%84"><span class="toc-text">3 元组</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-%E5%AD%97%E5%85%B8"><span class="toc-text">4 字典</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#5-%E9%9B%86%E5%90%88"><span class="toc-text">5 集合</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#6-%E5%9F%BA%E6%9C%AC%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E6%80%BB%E7%BB%93"><span class="toc-text">6 基本数据类型总结</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day10-%E5%AD%97%E7%AC%A6%E7%BC%96%E7%A0%81"><span class="toc-text">day10 字符编码</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-ascii%E8%A1%A8"><span class="toc-text">1 ascii表</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-GBK%EF%BC%88%E4%B8%AD%E5%9B%BD%EF%BC%89%EF%BC%8CShift-JIS%EF%BC%88%E6%97%A5%E6%9C%AC%EF%BC%89%E7%AD%89%E7%AD%89"><span class="toc-text">2 GBK（中国），Shift_JIS（日本）等等</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-unicode"><span class="toc-text">3 unicode</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-utf-8"><span class="toc-text">4 utf-8</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day11-12-%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C"><span class="toc-text">day11-12 文件操作</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E8%AF%BB%E7%9B%B8%E5%85%B3%E6%93%8D%E4%BD%9C%EF%BC%9A"><span class="toc-text">1 读相关操作：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E5%86%99%E7%9B%B8%E5%85%B3%E6%93%8D%E4%BD%9C%EF%BC%9A"><span class="toc-text">2 写相关操作：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-%E6%96%87%E4%BB%B6%E9%AB%98%E7%BA%A7%E6%93%8D%E4%BD%9C%EF%BC%9A"><span class="toc-text">3 文件高级操作：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day13-14-%E5%87%BD%E6%95%B0%E5%9F%BA%E7%A1%80"><span class="toc-text">day13-14 函数基础</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day15-%E5%90%8D%E7%A7%B0%E7%A9%BA%E9%97%B4%E5%92%8C%E4%BD%9C%E7%94%A8%E5%9F%9F"><span class="toc-text">day15 名称空间和作用域</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E5%91%BD%E5%90%8D%E5%85%B3%E9%94%AE%E5%AD%97%E5%8F%82%E6%95%B0%EF%BC%9A"><span class="toc-text">1 命名关键字参数：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E5%90%8D%E7%A7%B0%E7%A9%BA%E9%97%B4%E7%9A%84%E5%AD%98%E6%B4%BB%E6%97%B6%E9%97%B4"><span class="toc-text">2 名称空间的存活时间</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day16-%E9%97%AD%E5%8C%85%E5%87%BD%E6%95%B0"><span class="toc-text">day16 闭包函数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day17-%E8%A3%85%E9%A5%B0%E5%99%A8"><span class="toc-text">day17 装饰器</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%AD%A3%E8%A3%85%E9%A5%B0%E5%99%A8%EF%BC%9A"><span class="toc-text">修正装饰器：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day18-%E8%BF%AD%E4%BB%A3%E5%99%A8-%E7%94%9F%E6%88%90%E5%99%A8"><span class="toc-text">day18 迭代器+生成器</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E8%BF%AD%E4%BB%A3%E5%99%A8"><span class="toc-text">1 迭代器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E7%94%9F%E6%88%90%E5%99%A8"><span class="toc-text">2 生成器</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day19-%E7%94%9F%E6%88%90%E5%BC%8F"><span class="toc-text">day19 生成式</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E4%B8%89%E5%85%83%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="toc-text">1 三元表达式</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E7%94%9F%E6%88%90%E5%BC%8F"><span class="toc-text">2 生成式</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#2-1-%E5%88%97%E8%A1%A8%E7%94%9F%E6%88%90%E5%BC%8F"><span class="toc-text">2.1 列表生成式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-2-%E5%AD%97%E5%85%B8%E7%94%9F%E6%88%90%E5%BC%8F"><span class="toc-text">2.2 字典生成式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-3-%E9%9B%86%E5%90%88%E7%94%9F%E6%88%90%E5%BC%8F"><span class="toc-text">2.3 集合生成式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#2-4-%E7%94%9F%E6%88%90%E5%99%A8%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="toc-text">2.4 生成器表达式</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day20-%E5%8C%BF%E5%90%8D%E5%87%BD%E6%95%B0"><span class="toc-text">day20 匿名函数</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-lambda%E4%BD%BF%E7%94%A8"><span class="toc-text">1 lambda使用</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-lambda%E4%B8%8E%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%E7%9A%84%E5%BA%94%E7%94%A8"><span class="toc-text">2 lambda与内置函数的应用</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-map"><span class="toc-text">3 map</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-reduce"><span class="toc-text">4 reduce</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#5-filter"><span class="toc-text">5 filter</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day21%E6%A8%A1%E5%9D%97%EF%BC%88%E7%95%A5%EF%BC%89"><span class="toc-text">day21模块（略）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#day22-24-%E5%B8%B8%E7%94%A8%E6%A8%A1%E5%9D%97"><span class="toc-text">day22-24 常用模块</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-time%E6%A8%A1%E5%9D%97"><span class="toc-text">1 time模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-datetime%E6%A8%A1%E5%9D%97"><span class="toc-text">2 datetime模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-random%E6%A8%A1%E5%9D%97"><span class="toc-text">3 random模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-os"><span class="toc-text">4 os</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#5-sys%E6%A8%A1%E5%9D%97"><span class="toc-text">5 sys模块</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#6-shutil"><span class="toc-text">6 shutil</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#7-json-amp-pickle"><span class="toc-text">7 json&amp;pickle</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#8-hashlib"><span class="toc-text">8 hashlib</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#9-logging%EF%BC%88%E7%95%A5%EF%BC%89"><span class="toc-text">9 logging（略）</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#10-re%EF%BC%88%E7%95%A5%EF%BC%89"><span class="toc-text">10 re（略）</span></a></li></ol></li></ol></li></ol></li></ol></div></div></div></aside><main class="sidebar-translate" id="content"><div id="post"><article class="post-block" itemscope itemtype="https://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://huang_zhao.gitee.io/task/task/2020/03/15/python/%E5%AD%A6%E4%B9%A0/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%EF%BC%9Apython%E5%85%A5%E9%97%A8/"><span hidden itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="name" content="爱肖彤真是太好了"><meta itemprop="description"></span><span hidden itemprop="publisher" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="工藤旧二の博客"></span><header class="post-header"><h1 class="post-title" itemprop="name headline">4000字总结python基础</h1><div class="post-meta"><div class="post-time" style="display:block"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-line"></use></svg></span> <time title="创建时间：2020-03-15 13:33:43" itemprop="dateCreated datePublished" datetime="2020-03-15T13:33:43+08:00">2020-03-15</time><span class="post-meta-divider">-</span><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-calendar-2-line"></use></svg></span> <time title="修改时间：2021-07-01 13:29:27" itemprop="dateModified" datetime="2021-07-01T13:29:27+08:00">2021-07-01</time></div><span class="post-count"><span class="post-symbolcount"><span class="post-meta-item-icon" title="本文字数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-file-word-line"></use></svg></span> <span title="本文字数">4k</span><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读时长"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-timer-line"></use></svg></span> <span title="阅读时长">15m</span></span></span><span class="post-busuanzi"><span class="post-meta-divider">-</span><span class="post-meta-item-icon" title="阅读次数"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-eye-line"></use></svg> <span id="busuanzi_value_page_pv"></span></span></span><div class="post-classify"><span class="post-category"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-folder-line"></use></svg></span> <span itemprop="about" itemscope itemtype="https://schema.org/Thing"><a class="category" href="/task/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" style="--text-color:var(--hty-text-color)" itemprop="url" rel="index"><span itemprop="text">技术分享</span></a></span></span><span class="post-tag"><span class="post-meta-divider">-</span><a class="tag" href="/task/tags/python/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">python</span></a><a class="tag" href="/task/tags/python%E5%9F%BA%E7%A1%80/" style="--text-color:var(--hty-text-color)"><span class="post-meta-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-price-tag-3-line"></use></svg></span><span class="tag-name">python基础</span></a></span></div></div></header><section class="post-body" itemprop="articleBody"><div class="post-content markdown-body" style="--smc-primary:#0078E7;"><h1 id="核心知识点：python入门"><a href="#核心知识点：python入门" class="headerlink" title="核心知识点：python入门"></a>核心知识点：python入门</h1><h2 id="一、python入门day1-day24"><a href="#一、python入门day1-day24" class="headerlink" title="一、python入门day1-day24"></a>一、python入门day1-day24</h2><h3 id="day01-03-编程语言"><a href="#day01-03-编程语言" class="headerlink" title="day01-03 编程语言"></a>day01-03 编程语言</h3><p>python是一种强类型的解释型语言</p>
<h3 id="day04-变量"><a href="#day04-变量" class="headerlink" title="day04 变量"></a>day04 变量</h3><p>变量名不能以数字开头</p>
<p>小整数池的范围[-5,256]，pycharm里这个范围非常大</p>
<p>这是为了优化内存的合理安排</p>
<p>指向相同数字的变量名id相同</p>
<h3 id="day05-垃圾回收机制（GC机制）"><a href="#day05-垃圾回收机制（GC机制）" class="headerlink" title="day05 垃圾回收机制（GC机制）"></a>day05 垃圾回收机制（GC机制）</h3><p>为了解决没有被引用的数据（垃圾）大量占用内存导致程序崩溃</p>
<h4 id="1-引用计数"><a href="#1-引用计数" class="headerlink" title="1 引用计数"></a>1 引用计数</h4><p>a = 10 表示10被a引用了1次，a = 20 表示a和10断开链接，a与20相连接20的引用计数为1，10的引用计数为0（垃圾）</p>
<p>存在的问题：循环引用</p>
<pre class=" language-python"><code class="language-python">l1 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'xxx'</span><span class="token punctuation">]</span>
l2 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'yyy'</span><span class="token punctuation">]</span>
l1<span class="token punctuation">.</span>append<span class="token punctuation">(</span>l2<span class="token punctuation">)</span>
l2<span class="token punctuation">.</span>append<span class="token punctuation">(</span>l1<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true"># l1与l2循环引用了</span>
<span class="token comment" spellcheck="true"># 此时['xxx']被l1引用了1次，被['yyy']引用了一次，引用计数为2</span>
<span class="token comment" spellcheck="true"># 此时['yyy']被l1引用了1次，被['xxx']引用了一次，引用计数为2</span>

<span class="token keyword">del</span> l1
<span class="token keyword">del</span> l2
<span class="token comment" spellcheck="true"># 按照常规['xxx']['yyy']此时的引用计数为0要被清除，但是由于循环引用的问题，他们俩彼此互相引用导致引用计数失效</span></code></pre>
<h4 id="2-标记清除"><a href="#2-标记清除" class="headerlink" title="2 标记清除"></a>2 标记清除</h4><p>标记清除是当内存即将被程序占满的时候，把程序停下来，进行标记清除</p>
<p>标记清除分为两步：</p>
<ul>
<li>标记<ul>
<li>遍历所有的GC Roots对象（<strong>栈区内所有的名字或者线程</strong>），将所有可以被直接或者间接访问到的<strong>堆区对象</strong>标记存活</li>
</ul>
</li>
<li>清除<ul>
<li>遍历堆区所有对象，没有被标记的就清除。</li>
</ul>
</li>
</ul>
<p>刚刚循环引用的地方，堆区的两个列表虽然互相引用，但是他们没有被栈区的任何对象直接或者间接访问，所以没有被标记，就被清除了。</p>
<h4 id="3-分代回收"><a href="#3-分代回收" class="headerlink" title="3 分代回收"></a>3 分代回收</h4><p>分代回收解决了引用计数的第二个问题，效率</p>
<p>工作原理：根据栈区中名字的使用频率为他们划分代，不同代的名字扫描频率不同。</p>
<h3 id="day05-程序交互与基本运算符"><a href="#day05-程序交互与基本运算符" class="headerlink" title="day05 程序交互与基本运算符"></a>day05 程序交互与基本运算符</h3><p>/ 除，显示小数点</p>
<p>// 取整除，不显示小数点</p>
<p><strong>解压赋值</strong></p>
<pre class=" language-python"><code class="language-python">num <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>

<span class="token comment" spellcheck="true"># 全部解压</span>
a<span class="token punctuation">,</span>b<span class="token punctuation">,</span>c<span class="token punctuation">,</span>d <span class="token operator">=</span> num
<span class="token operator">>></span><span class="token operator">></span> a<span class="token operator">=</span><span class="token number">1</span> b<span class="token operator">=</span><span class="token number">2</span> c<span class="token operator">=</span><span class="token number">3</span> d<span class="token operator">=</span><span class="token number">4</span>

<span class="token comment" spellcheck="true"># 部分解压</span>
a<span class="token punctuation">,</span>b<span class="token punctuation">,</span><span class="token operator">*</span>_<span class="token operator">=</span>num
<span class="token operator">>></span><span class="token operator">></span> a<span class="token operator">=</span><span class="token number">1</span> b<span class="token operator">=</span><span class="token number">2</span></code></pre>
<h3 id="day06-可变不可变类型"><a href="#day06-可变不可变类型" class="headerlink" title="day06 可变不可变类型"></a>day06 可变不可变类型</h3><p>可变类型：列表，字典（key：不可变类型，value：任意类型）</p>
<p>不可变类型：整形，浮点型，字符串，bool</p>
<h3 id="day07-流程控制"><a href="#day07-流程控制" class="headerlink" title="day07 流程控制"></a>day07 流程控制</h3><p><strong>深浅拷贝</strong></p>
<h4 id="1-赋值"><a href="#1-赋值" class="headerlink" title="1 赋值 ="></a>1 赋值 =</h4><pre class=" language-python"><code class="language-python">l1 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
l2 <span class="token operator">=</span> l1
<span class="token comment" spellcheck="true"># 这时候l1 就是l2，id相同，对l1内部的可变类型不可变类型的修改都会影响l2</span></code></pre>
<h4 id="2-浅拷贝-copy"><a href="#2-浅拷贝-copy" class="headerlink" title="2 浅拷贝 copy"></a>2 浅拷贝 copy</h4><pre class=" language-python"><code class="language-python">l1 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
l2 <span class="token operator">=</span> l1<span class="token punctuation">.</span>copy<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token comment" spellcheck="true"># 把l1内部的第一层内存地址都copy给l2，l1和l2是两个id不同的列表</span>
<span class="token comment" spellcheck="true"># 内部的可变类型其实是同一个，所以会同时修改</span>
<span class="token comment" spellcheck="true"># 修改l1内部的不可变类型，l2不会跟着变</span>
<span class="token comment" spellcheck="true"># 修改l1内部的可变类型，l2也会变</span></code></pre>
<h4 id="3-深拷贝-deepcopy"><a href="#3-深拷贝-deepcopy" class="headerlink" title="3 深拷贝 deepcopy"></a>3 深拷贝 deepcopy</h4><pre class=" language-python"><code class="language-python"><span class="token keyword">import</span> copy 
l1 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
l2 <span class="token operator">=</span> copy<span class="token punctuation">.</span>deepcopy<span class="token punctuation">(</span>l1<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true"># 把l1内部的第一层内存地址都copy给l2，l1和l2是两个id不同的列表</span>
<span class="token comment" spellcheck="true"># 不同的是，可变类型会在内存中复制一份，所以修改可变类型其实是不同的</span></code></pre>
<p>这里注意的点就是可变类型的修改和不可变类型修改的区别</p>
<p>不可变类型直接会断开和原数据的链接，重新链接新数据</p>
<p>可变类型则是在原数据上进行修改</p>
<h3 id="day08-10-基本数据类型"><a href="#day08-10-基本数据类型" class="headerlink" title="day08-10 基本数据类型"></a>day08-10 基本数据类型</h3><h4 id="1-字符串"><a href="#1-字符串" class="headerlink" title="1 字符串"></a>1 字符串</h4><ul>
<li><p>strip 去掉左右两边指定字符，默认空格（扩展：rsrip，lsrip）</p>
</li>
<li><p>split 从左到右以指定字符切割，默认空格，可以指定次数，默认全部（扩展rsplit，从右到左以指定字符切割）</p>
</li>
<li><p>lower 全大写，upper 全小写</p>
</li>
<li><p>srartswith 以什么为开头，endwith 以什么为结尾</p>
</li>
<li><pre class=" language-python"><code class="language-python"><span class="token string">','</span>join<span class="token punctuation">(</span><span class="token string">'hz'</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true"># 分隔字符串</span>
<span class="token operator">>></span><span class="token operator">></span> h<span class="token punctuation">,</span>z</code></pre>
</li>
<li><p>replace 替换字符</p>
</li>
<li><p>isdigit 判断是否纯数字</p>
</li>
<li><p>find 查找是否有指定字符有则返回索引，无则返回-1</p>
</li>
<li><p>index查找是否有指定字符，有则返回索引，无则报错</p>
</li>
<li><p>count 统计赐重复出现的个数</p>
</li>
</ul>
<h4 id="2-列表"><a href="#2-列表" class="headerlink" title="2 列表"></a>2 列表</h4><ul>
<li><p>append 追加元素</p>
</li>
<li><p>extend 追加可迭代对象，会自动把可迭代对象循环添加，列表会循环添加key</p>
</li>
<li><p>insert 插入</p>
</li>
<li><p>del 常规删除，没有返回值</p>
<ul>
<li><pre class=" language-python"><code class="language-python">x <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'aa'</span><span class="token punctuation">,</span><span class="token string">'bb'</span><span class="token punctuation">]</span>
<span class="token keyword">del</span> x<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span></code></pre>
</li>
</ul>
</li>
<li><p>pop 索引删除，不写默认删除最后一个，返回值为删除的元素</p>
</li>
<li><p>remove 指名道姓删除，返回值为None</p>
</li>
<li><p>count 统计指定元素出现次数</p>
</li>
<li><p>index 查找指定元素索引</p>
</li>
<li><p>clear 清空索引</p>
</li>
<li><p>reverse 反转列表</p>
</li>
<li><p>sort 排序</p>
</li>
</ul>
<h4 id="3-元组"><a href="#3-元组" class="headerlink" title="3 元组"></a>3 元组</h4><p>看做是不可修改的列表</p>
<p>注意：元组内必须加逗号，如果一个或者没有元素的时候元组不加逗号会看成数学的括号</p>
<ul>
<li>index 查找指定元素索引</li>
<li>count 统计指定元素出现次数</li>
</ul>
<h4 id="4-字典"><a href="#4-字典" class="headerlink" title="4 字典"></a>4 字典</h4><ul>
<li>get 取值，和索引取的区别是get取不到返回None，索引取不到报错</li>
<li>pop 删除，返回值为key</li>
<li>popitem 随机删除，删除的键值对以（key，value）的形式返回</li>
<li>update 更新，存在则修改，不存在则新增</li>
<li>setdefault 新增，key不存在则新增，key存在则返回原来的value值</li>
</ul>
<p><strong>注意</strong>：</p>
<p>python3.5之后的字典是有序字典，因为更新之后优化了内部字典的存值方式，把原来的二维数组分成了现在一个一维数组+一个二维数组，但是原本创建一个字典就会创建8个位置，现在是创建一个字典生成一个位置</p>
<h4 id="5-集合"><a href="#5-集合" class="headerlink" title="5 集合"></a>5 集合</h4><p>可以把可变类型转化成集合在转回来可以去重，但是这种去重是无序的</p>
<ul>
<li>关系运算<ul>
<li>&amp; 交集 共有的</li>
<li>| 合集 融合去重</li>
<li>— 差集 某个集合单有的</li>
<li>^ 对称差集 两个集合单独有的的合集</li>
<li>＞ 父子集 判断是否包含</li>
</ul>
</li>
<li>discard 删除，存在则删除，不存在不变化</li>
<li>remove 删除，存在则删除，不存在则报错</li>
<li>update 更新，括号内放集合，会自动与元集合取合集</li>
<li>pop 删除指定元素，并返回，不写删除第一个</li>
<li>add 添加元素，只能添加不可变类型</li>
</ul>
<h4 id="6-基本数据类型总结"><a href="#6-基本数据类型总结" class="headerlink" title="6 基本数据类型总结"></a>6 基本数据类型总结</h4><p>不包含集合</p>
<ul>
<li>按照存值个数区分<ul>
<li>只能存一个值：数字，字符串</li>
<li>可以存多个值：字典，列表，元组</li>
</ul>
</li>
<li>按访问方式区分<ul>
<li>直接访问：数字</li>
<li>顺序访问/索引访问：字符串，列表，元组</li>
<li>key访问：字典</li>
</ul>
</li>
<li>可变不可变区分<ul>
<li>可变：列表，字典，集合</li>
<li>不可变：数字，元组，字符串</li>
</ul>
</li>
</ul>
<h3 id="day10-字符编码"><a href="#day10-字符编码" class="headerlink" title="day10 字符编码"></a>day10 字符编码</h3><h4 id="1-ascii表"><a href="#1-ascii表" class="headerlink" title="1 ascii表"></a>1 ascii表</h4><p>只有英文字符与数字的一一对应关系</p>
<p>一个英文字符对应一个字节（bytes），一个字节等于8个bit，8个bit最多包含256个数字</p>
<h4 id="2-GBK（中国），Shift-JIS（日本）等等"><a href="#2-GBK（中国），Shift-JIS（日本）等等" class="headerlink" title="2 GBK（中国），Shift_JIS（日本）等等"></a>2 GBK（中国），Shift_JIS（日本）等等</h4><p>只有对应国家的文字和英文字符与数字的一一对应关系</p>
<p>2字节代表一个汉字</p>
<h4 id="3-unicode"><a href="#3-unicode" class="headerlink" title="3 unicode"></a>3 unicode</h4><p>此时只能转换成对应字符编码的二进制，当出现unicode的时候开始统一</p>
<p>所有存在的文字都有与数字的一一对应关系，而传统的GBK等字符编码也能在unicode内找到对应关系</p>
<h4 id="4-utf-8"><a href="#4-utf-8" class="headerlink" title="4 utf-8"></a>4 utf-8</h4><p>当我们出现要输入多国语言的时候，unicode就会显得很臃肿</p>
<p>utf-8会显得更灵活</p>
<p>utf-8是针对unicode的可变长度字符编码，一个英文字符占一个bytes，一个汉字占3个，生僻字占更多</p>
<h3 id="day11-12-文件操作"><a href="#day11-12-文件操作" class="headerlink" title="day11-12 文件操作"></a>day11-12 文件操作</h3><p>with 上下文资源管理，会自动帮我们在次级代码结束后关闭文件</p>
<p>显示模式：t文本模式（默认），b二进制</p>
<p>操作模式：r只读（默认），w只写，a只追加，+全都能读能写</p>
<h4 id="1-读相关操作："><a href="#1-读相关操作：" class="headerlink" title="1 读相关操作："></a>1 读相关操作：</h4><ul>
<li>readline 一次读一行</li>
<li>readlines 把文件内容按照换行符为分隔返回列表</li>
<li>read 读取全部内容</li>
</ul>
<h4 id="2-写相关操作："><a href="#2-写相关操作：" class="headerlink" title="2 写相关操作："></a>2 写相关操作：</h4><ul>
<li>write 写入全部内容</li>
<li>writelines 是readlines的反操作</li>
</ul>
<p>flsh 刷新</p>
<h4 id="3-文件高级操作："><a href="#3-文件高级操作：" class="headerlink" title="3 文件高级操作："></a>3 文件高级操作：</h4><p>f.seek(n，模式) n代表移动的字节数</p>
<ul>
<li>0模式，参照物是文件的开头</li>
<li>1模式，参照物是光标当前所在位置</li>
<li>2模式，参照物是文件末尾，n为负数倒着移动</li>
<li>f.tell（）得到当前光标所在位置</li>
</ul>
<h3 id="day13-14-函数基础"><a href="#day13-14-函数基础" class="headerlink" title="day13-14 函数基础"></a>day13-14 函数基础</h3><p>函数的返回值如果是多个元素，会自动放在一个元组内</p>
<h3 id="day15-名称空间和作用域"><a href="#day15-名称空间和作用域" class="headerlink" title="day15 名称空间和作用域"></a>day15 名称空间和作用域</h3><h4 id="1-命名关键字参数："><a href="#1-命名关键字参数：" class="headerlink" title="1 命名关键字参数："></a>1 命名关键字参数：</h4><p>在传参时，*后面的都是命名关键字参数</p>
<p>特点是必须要以关键字传参方式传</p>
<h4 id="2-名称空间的存活时间"><a href="#2-名称空间的存活时间" class="headerlink" title="2 名称空间的存活时间"></a>2 名称空间的存活时间</h4><ul>
<li>内置名称空间，解释器启动则存活，解释器关闭则销毁</li>
<li>全局名称空间，文件执行则存活，文件关闭则销毁</li>
<li>局部名称空间，调用函数时存活，调用完毕后销毁</li>
</ul>
<h3 id="day16-闭包函数"><a href="#day16-闭包函数" class="headerlink" title="day16 闭包函数"></a>day16 闭包函数</h3><p>定义：是内嵌函数，引用了外部名称空间的名字</p>
<h3 id="day17-装饰器"><a href="#day17-装饰器" class="headerlink" title="day17 装饰器"></a>day17 装饰器</h3><p>定义：给其他函数添加额外功能的工具</p>
<p>开放封闭原则：对扩展功能开放，对修改内部代码封闭（多处引用，修改可能会导致错乱）</p>
<p>无参装饰器只要两层函数，调用装饰器的时候不能加括号</p>
<p>有参装饰器需要在无参装饰器外面再加一层函数用于接收参数</p>
<h4 id="修正装饰器："><a href="#修正装饰器：" class="headerlink" title="修正装饰器："></a>修正装饰器：</h4><p>functools模块下提供的一个装饰器，可以让我们在使用装饰器的时候让原函数看起来还和原来一样</p>
<pre class=" language-python"><code class="language-python"><span class="token keyword">from</span> functools <span class="token keyword">import</span> wraps
<span class="token keyword">def</span> <span class="token function">timer</span><span class="token punctuation">(</span>func<span class="token punctuation">)</span><span class="token punctuation">:</span>
    @wraps<span class="token punctuation">(</span>func<span class="token punctuation">)</span>
    <span class="token keyword">def</span> <span class="token function">wrapper</span><span class="token punctuation">(</span><span class="token operator">*</span>args<span class="token punctuation">,</span><span class="token operator">**</span>kwargs<span class="token punctuation">)</span><span class="token punctuation">:</span>
        start_time<span class="token operator">=</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        res<span class="token operator">=</span>func<span class="token punctuation">(</span><span class="token operator">*</span>args<span class="token punctuation">,</span><span class="token operator">**</span>kwargs<span class="token punctuation">)</span>
        stop_time<span class="token operator">=</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'run time is %s'</span> <span class="token operator">%</span><span class="token punctuation">(</span>stop_time<span class="token operator">-</span>start_time<span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> res
    <span class="token keyword">return</span> wrapper</code></pre>
<p>用print（help（func））来判断是否和原函数一致</p>
<h3 id="day18-迭代器-生成器"><a href="#day18-迭代器-生成器" class="headerlink" title="day18 迭代器+生成器"></a>day18 迭代器+生成器</h3><h4 id="1-迭代器"><a href="#1-迭代器" class="headerlink" title="1 迭代器"></a>1 迭代器</h4><p>可迭代对象：内置有<code>__iter__</code>方法的对象</p>
<p>可迭代对象转换成迭代器对象：使用<code>__iter__</code>方法</p>
<p>迭代器对象：内置有<code>__iter__</code> ，<code>__next__</code>方法的对象</p>
<p>可迭代对象：列表，字符串，字典，元组，集合，文件对象</p>
<p>迭代器对象：文件对象</p>
<p>迭代器的优点：</p>
<ul>
<li>为序列和非序列类型提供了一种统一的取值方式</li>
<li>惰性计算，同一时间只存在一个数据，不会影响内存，其他数据类型存就是整体存</li>
</ul>
<p>迭代器的缺点：</p>
<ul>
<li>除非取完整个迭代器，不然不知道迭代器长度</li>
<li>无法控制取值，永远只能取下一个，如果要重新开始只能重新定义一个迭代器对象</li>
</ul>
<h4 id="2-生成器"><a href="#2-生成器" class="headerlink" title="2 生成器"></a>2 生成器</h4><p>生成器就是自定义迭代器，有yeild关键字的函数调用不会执行，会返回一个生成器，通过yeild关键字在指定位置挂起函数，通过<code>__next__</code>方法来继续执行函数直到下一次挂起或者return，yeild可以接受参数，也可以和return一样返回参数。</p>
<h3 id="day19-生成式"><a href="#day19-生成式" class="headerlink" title="day19 生成式"></a>day19 生成式</h3><h4 id="1-三元表达式"><a href="#1-三元表达式" class="headerlink" title="1 三元表达式"></a>1 三元表达式</h4><pre><code>条件成立时运行的代码 if 条件 else 条件不成立时运行的代码</code></pre>
<h4 id="2-生成式"><a href="#2-生成式" class="headerlink" title="2 生成式"></a>2 生成式</h4><h5 id="2-1-列表生成式"><a href="#2-1-列表生成式" class="headerlink" title="2.1 列表生成式"></a>2.1 列表生成式</h5><pre class=" language-python"><code class="language-python">l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">"a"</span><span class="token punctuation">,</span><span class="token string">"b"</span><span class="token punctuation">,</span><span class="token string">"c2"</span><span class="token punctuation">,</span><span class="token string">"adsa"</span><span class="token punctuation">,</span><span class="token string">"z"</span><span class="token punctuation">]</span>
<span class="token comment" spellcheck="true">#需求：把列表内长度大于1的值添加到新列表new_l中</span>
new_l <span class="token operator">=</span> <span class="token punctuation">[</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> l <span class="token keyword">if</span> len<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token operator">></span><span class="token number">1</span><span class="token punctuation">]</span></code></pre>
<h5 id="2-2-字典生成式"><a href="#2-2-字典生成式" class="headerlink" title="2.2 字典生成式"></a>2.2 字典生成式</h5><pre class=" language-python"><code class="language-python">d <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token string">"a"</span><span class="token punctuation">:</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">"b"</span><span class="token punctuation">:</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">"c"</span><span class="token punctuation">:</span><span class="token number">3</span><span class="token punctuation">}</span> <span class="token comment" spellcheck="true"># 这个d只要是个可迭代对象即可</span>
<span class="token comment" spellcheck="true">#生成一个新的字典，key是d中的所有key，value为none</span>
new_d <span class="token operator">=</span> <span class="token punctuation">{</span>key<span class="token punctuation">:</span>None <span class="token keyword">for</span> key <span class="token keyword">in</span> d <span class="token punctuation">}</span></code></pre>
<h5 id="2-3-集合生成式"><a href="#2-3-集合生成式" class="headerlink" title="2.3 集合生成式"></a>2.3 集合生成式</h5><pre class=" language-python"><code class="language-python"><span class="token comment" spellcheck="true"># 生成一个包含数字1-9的集合</span>
s <span class="token operator">=</span><span class="token punctuation">{</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> range<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">}</span></code></pre>
<h5 id="2-4-生成器表达式"><a href="#2-4-生成器表达式" class="headerlink" title="2.4 生成器表达式"></a>2.4 生成器表达式</h5><pre class=" language-python"><code class="language-python">g <span class="token operator">=</span> <span class="token punctuation">(</span>i <span class="token keyword">for</span> i <span class="token keyword">in</span> range<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span> <span class="token keyword">if</span> i <span class="token operator">></span><span class="token number">3</span><span class="token punctuation">)</span></code></pre>
<h3 id="day20-匿名函数"><a href="#day20-匿名函数" class="headerlink" title="day20 匿名函数"></a>day20 匿名函数</h3><h4 id="1-lambda使用"><a href="#1-lambda使用" class="headerlink" title="1 lambda使用"></a>1 lambda使用</h4><pre><code>lambda 参数1,参数2... : 返回值</code></pre>
<h4 id="2-lambda与内置函数的应用"><a href="#2-lambda与内置函数的应用" class="headerlink" title="2 lambda与内置函数的应用"></a>2 lambda与内置函数的应用</h4><pre class=" language-python"><code class="language-python">dict1 <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token string">"hz"</span><span class="token punctuation">:</span><span class="token number">10011</span><span class="token punctuation">,</span><span class="token string">"lxt"</span><span class="token punctuation">:</span><span class="token number">1234</span><span class="token punctuation">,</span><span class="token string">"hzxc"</span><span class="token punctuation">:</span><span class="token number">101</span><span class="token punctuation">}</span>
res <span class="token operator">=</span> max<span class="token punctuation">(</span>dict1<span class="token punctuation">,</span>key<span class="token operator">=</span><span class="token keyword">lambda</span> k<span class="token punctuation">:</span>dict1<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span></code></pre>
<h4 id="3-map"><a href="#3-map" class="headerlink" title="3 map"></a>3 map</h4><pre class=" language-python"><code class="language-python"><span class="token comment" spellcheck="true"># 映射：把一个可迭代对象的每一个值拿出来作为函数的参数运行一次，把得到的值合并起来生成一个迭代器</span>
l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
res <span class="token operator">=</span> map<span class="token punctuation">(</span><span class="token keyword">lambda</span> x<span class="token punctuation">:</span>x<span class="token operator">**</span><span class="token number">2</span><span class="token punctuation">,</span>l<span class="token punctuation">)</span></code></pre>
<h4 id="4-reduce"><a href="#4-reduce" class="headerlink" title="4 reduce"></a>4 reduce</h4><pre class=" language-python"><code class="language-python"><span class="token comment" spellcheck="true">#reduce函数可以接收三个参数，一个是函数，第二个是可迭代对象，第三个是初始值</span>
<span class="token keyword">from</span> functools <span class="token keyword">import</span>  reduce
l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
res <span class="token operator">=</span> reduce<span class="token punctuation">(</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">+</span>y<span class="token punctuation">,</span>l<span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token operator">>></span><span class="token operator">></span> <span class="token number">11</span>
<span class="token comment" spellcheck="true"># 如果有初始值就会把初始值作为第一个参数传入，然后取出可迭代对象的第一个值作为第二个参数传入，得到的返回值作为下一次函数运行时的x，再把可迭代对象的第二个参数传入，一直调用函数直到可迭代对象循环结束</span></code></pre>
<h4 id="5-filter"><a href="#5-filter" class="headerlink" title="5 filter"></a>5 filter</h4><pre class=" language-python"><code class="language-python"><span class="token comment" spellcheck="true">#过滤列表l</span>
l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
res <span class="token operator">=</span> filter<span class="token punctuation">(</span><span class="token keyword">lambda</span> x<span class="token punctuation">:</span>x<span class="token operator">></span><span class="token number">3</span><span class="token punctuation">,</span>l<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true">#filter会迭代列表l把得到的值传给匿名函数，如果得到结果为真，则过滤出该元素，得到一个迭代器</span>
res <span class="token operator">>></span><span class="token operator">></span> <span class="token number">4</span></code></pre>
<h3 id="day21模块（略）"><a href="#day21模块（略）" class="headerlink" title="day21模块（略）"></a>day21模块（略）</h3><h3 id="day22-24-常用模块"><a href="#day22-24-常用模块" class="headerlink" title="day22-24 常用模块"></a>day22-24 常用模块</h3><h4 id="1-time模块"><a href="#1-time模块" class="headerlink" title="1 time模块"></a>1 time模块</h4><ul>
<li>time.time() 时间戳：从1970年到现在的秒数</li>
<li>time.strftime() 格式化时间</li>
<li>time.locatime() 结构化时间（共9个元素）</li>
</ul>
<p>注意：结构化时间可以和时间戳互相转换，结构化时间也可以和格式化时间互相转换</p>
<h4 id="2-datetime模块"><a href="#2-datetime模块" class="headerlink" title="2 datetime模块"></a>2 datetime模块</h4><p>datetime.datatime.now()获取当前时间，精确到毫秒，格式化时间</p>
<h4 id="3-random模块"><a href="#3-random模块" class="headerlink" title="3 random模块"></a>3 random模块</h4><ul>
<li><p>random.random() 取0到1之间的小数</p>
</li>
<li><p>random.randint(1,3) 取大于等于1，小于等于3的整数</p>
</li>
<li><p>random.randrange(1,3) 取大于等于1，小于3的整数</p>
</li>
<li><p>random.choice([1,2,3,4,5,6]) 列表或元组内部随机取一个元素</p>
</li>
<li><p>random.sample([1,2,3,4,5,6]，n) 列表或元组内部随机取n个元素组合成列表</p>
</li>
<li><p>random.uniform(1,3) 取大于1小于3的小数</p>
</li>
<li><pre class=" language-python"><code class="language-python">l1 <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span>
random<span class="token punctuation">.</span>shuffle<span class="token punctuation">(</span>l1<span class="token punctuation">)</span>
<span class="token comment" spellcheck="true"># 把一个列表打乱</span></code></pre>
</li>
</ul>
<h4 id="4-os"><a href="#4-os" class="headerlink" title="4 os"></a>4 os</h4><ul>
<li>os.path.getsize(‘文件路径’) 计算该文件大小</li>
<li>os.path.dirname/basename(‘文件路径’) 获得该文件的父级目录/获得该文件的文件名</li>
<li>os.path.isfile(r’文件路径’) 是否是一个存在的文件，返回布尔值</li>
<li>os.path.isdir(r’文件路径’) 是否是一个存在的目录，返回布尔值</li>
<li>os.path.abspath(<code>__file__</code>) 获取当前文件路径</li>
<li>os.path.dirname(‘文件路径’) 获取当前文件路径的父级路径</li>
<li>os.mkdir(‘dirname’)    生成单级目录；相当于shell中mkdir dirname</li>
<li>os.path.exists(‘文件路径’)  如果path存在，返回True；如果path不存在，返回False</li>
</ul>
<h4 id="5-sys模块"><a href="#5-sys模块" class="headerlink" title="5 sys模块"></a>5 sys模块</h4><p>sys.path.append(‘文件路径’) 给环境变量列表添加一个路径</p>
<p>通常用于解决跨文件导包的问题</p>
<h4 id="6-shutil"><a href="#6-shutil" class="headerlink" title="6 shutil"></a>6 shutil</h4><p>用于拷贝文件</p>
<ul>
<li>shutil.copy(文件1，文件2) 拷贝文件和权限</li>
<li>shutil.copy2(文件1，文件2) 拷贝文件和状态信息</li>
</ul>
<h4 id="7-json-amp-pickle"><a href="#7-json-amp-pickle" class="headerlink" title="7 json&amp;pickle"></a>7 json&amp;pickle</h4><ul>
<li>json.loads(‘数据’) 序列化</li>
<li>json.dumps(‘数据’) 反序列化</li>
<li>pickle.loads(‘数据’) 序列化</li>
<li>pickle.dumps(‘数据’) 反序列化</li>
</ul>
<p>两者的区别：json序列化成json数据可以供所有语言反序列化，pickle转化成pickle格式只能供python反序列化</p>
<h4 id="8-hashlib"><a href="#8-hashlib" class="headerlink" title="8 hashlib"></a>8 hashlib</h4><p>hash算法的模块</p>
<p>hash值的特点：</p>
<ul>
<li>只要传的值一样，用同样的hash算法得到的hash值必定一样<ul>
<li>可用于传输密码和验证文件的完整性</li>
</ul>
</li>
<li>不能由hash值反解成原来的内容</li>
<li>只要hash算法不变，无论检验的内容由多大，hash值都是定长</li>
</ul>
<p>基本操作：</p>
<pre class=" language-python"><code class="language-python"><span class="token keyword">import</span> hashlib
pwd <span class="token operator">=</span> <span class="token number">123456789</span>
<span class="token comment" spellcheck="true"># 实例化md5对象，可以传任意参数，参数会跟着数据一起加密简称 加盐</span>
m <span class="token operator">=</span> hashlib<span class="token punctuation">.</span>md5<span class="token punctuation">(</span><span class="token string">'盐'</span><span class="token punctuation">)</span>
m<span class="token punctuation">.</span>update<span class="token punctuation">(</span>pwd<span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">'utf-8'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
pwd_md5 <span class="token operator">=</span> m<span class="token punctuation">.</span>hexdigest<span class="token punctuation">(</span><span class="token punctuation">)</span></code></pre>
<h4 id="9-logging（略）"><a href="#9-logging（略）" class="headerlink" title="9 logging（略）"></a>9 logging（略）</h4><h4 id="10-re（略）"><a href="#10-re（略）" class="headerlink" title="10 re（略）"></a>10 re（略）</h4><p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/hz2lxt/p/12614863.html">https://www.cnblogs.com/hz2lxt/p/12614863.html</a></p>
</div><div id="reward-container"><span class="hty-icon-button button-glow" id="reward-button" title="打赏" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === &quot;none&quot;) ? &quot;block&quot; : &quot;none&quot;;"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-hand-coin-line"></use></svg></span><div id="reward-comment">点我就给你看点有意思的</div><div id="qr" style="display:none;"><div style="display:inline-block"><a target="_blank" rel="noopener" href="https://gitee.com/huang_zhao/hz/raw/master/hz/alipay.png"><img loading="lazy" src="https://gitee.com/huang_zhao/hz/raw/master/hz/alipay.png" alt="支付宝" title="支付宝"></a><div><span style="color:#00A3EE"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-alipay-line"></use></svg></span></div></div><div style="display:inline-block"><a target="_blank" rel="noopener" href="https://gitee.com/huang_zhao/hz/raw/master/hz/qqpay.jpg"><img loading="lazy" src="https://gitee.com/huang_zhao/hz/raw/master/hz/qqpay.jpg" alt="QQ 支付" title="QQ 支付"></a><div><span style="color:#12B7F5"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-qq-line"></use></svg></span></div></div><div style="display:inline-block"><a target="_blank" rel="noopener" href="https://gitee.com/huang_zhao/hz/raw/master/hz/wxpay.jpg"><img loading="lazy" src="https://gitee.com/huang_zhao/hz/raw/master/hz/wxpay.jpg" alt="微信支付" title="微信支付"></a><div><span style="color:#2DC100"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat-pay-line"></use></svg></span></div></div></div></div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者：</strong>爱肖彤真是太好了</li><li class="post-copyright-link"><strong>本文链接：</strong><a href="http://huang_zhao.gitee.io/task/2020/03/15/python/%E5%AD%A6%E4%B9%A0/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%EF%BC%9Apython%E5%85%A5%E9%97%A8/" title="4000字总结python基础">http://huang_zhao.gitee.io/task/2020/03/15/python/%E5%AD%A6%E4%B9%A0/%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%EF%BC%9Apython%E5%85%A5%E9%97%A8/</a></li><li class="post-copyright-license"><strong>版权声明：</strong>本博客所有文章除特别声明外，均默认采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank" rel="noopener" title="CC BY-NC-SA 4.0 "><svg class="icon"><use xlink:href="#icon-creative-commons-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-by-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-nc-line"></use></svg><svg class="icon"><use xlink:href="#icon-creative-commons-sa-line"></use></svg></a> 许可协议。</li></ul></section></article><div class="post-nav"><div class="post-nav-item"><a class="post-nav-prev" href="/task/2020/03/15/%E5%85%B6%E4%BB%96/%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98%E5%8F%8A%E8%A7%A3%E5%86%B3/" rel="prev" title="跨域问题及解决"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-left-s-line"></use></svg><span class="post-nav-text">跨域问题及解决</span></a></div><div class="post-nav-item"><a class="post-nav-next" href="/task/2020/03/15/python/%E7%88%AC%E8%99%AB/selenium%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/" rel="next" title="selenium基本使用"><span class="post-nav-text">selenium基本使用</span><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-right-s-line"></use></svg></a></div></div></div></main><footer class="sidebar-translate" id="footer"><div class="copyright"><span>&copy; 2019 – 2022 </span><span class="with-love" id="animate"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-cloud-line"></use></svg></span><span class="author"> 爱肖彤真是太好了</span></div><div class="powered"><span>由 <a href="https://hexo.io" target="_blank" rel="noopener">Hexo</a> 驱动 v5.1.1</span><span class="footer-separator">|</span><span>主题 - <a rel="noopener" href="https://github.com/YunYouJun/hexo-theme-yun" target="_blank"><span>Yun</span></a> v0.9.7</span></div><div class="live_time"><span>本博客已萌萌哒地运行</span><span id="display_live_time"></span><span class="moe-text">(●'◡'●)</span><script>function blog_live_time() {
  window.setTimeout(blog_live_time, 1000);
  const start = new Date('2019-04-12T00:00:00');
  const now = new Date();
  const timeDiff = (now.getTime() - start.getTime());
  const msPerMinute = 60 * 1000;
  const msPerHour = 60 * msPerMinute;
  const msPerDay = 24 * msPerHour;
  const passDay = Math.floor(timeDiff / msPerDay);
  const passHour = Math.floor((timeDiff % msPerDay) / 60 / 60 / 1000);
  const passMinute = Math.floor((timeDiff % msPerHour) / 60 / 1000);
  const passSecond = Math.floor((timeDiff % msPerMinute) / 1000);
  display_live_time.innerHTML = " " + passDay + " 天 " + passHour + " 小时 " + passMinute + " 分 " + passSecond + " 秒";
}
blog_live_time();
</script></div><div id="busuanzi"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span id="busuanzi_container_site_uv" title="总访客量"><span><svg class="icon" aria-hidden="true"><use xlink:href="#icon-user-line"></use></svg></span><span id="busuanzi_value_site_uv"></span></span><span class="footer-separator">|</span><span id="busuanzi_container_site_pv" title="总访问量"><span><svg class="icon" aria-hidden="true"><use xlink:href="#icon-eye-line"></use></svg></span><span id="busuanzi_value_site_pv"></span></span></div></footer><a class="hty-icon-button" id="goUp" aria-label="back-to-top" href="#"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-arrow-up-s-line"></use></svg><svg class="progress-circle-container" viewBox="0 0 100 100"><circle class="progress-circle" id="progressCircle" cx="50" cy="50" r="48" fill="none" stroke="#0078E7" stroke-width="2" stroke-linecap="round"></circle></svg></a><a class="popup-trigger hty-icon-button icon-search" id="search" href="javascript:;" title="搜索"><span class="site-state-item-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search-line"></use></svg></span></a><script>window.addEventListener("DOMContentLoaded", () => {
  // Handle and trigger popup window
  document.querySelector(".popup-trigger").addEventListener("click", () => {
    document.querySelector(".popup").classList.add("show");
    setTimeout(() => {
      document.querySelector(".search-input").focus();
    }, 100);
  });

  // Monitor main search box
  const onPopupClose = () => {
    document.querySelector(".popup").classList.remove("show");
  };

  document.querySelector(".popup-btn-close").addEventListener("click", () => {
    onPopupClose();
  });

  window.addEventListener("keyup", event => {
    if (event.key === "Escape") {
      onPopupClose();
    }
  });
});
</script><script src="/task/js/search/local-search.js" defer></script><div class="popup search-popup"><div class="search-header"><span class="popup-btn-close close-icon hty-icon-button"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-close-line"></use></svg></span></div><div class="search-input-container"><input class="search-input" id="local-search-input" type="text" placeholder="搜索..." value=""></div><div id="local-search-result"></div></div></div><script defer src="/task/js/utils.js"></script><script defer src="/task/js/hexo-theme-yun.js"></script></body></html>